ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -> highest priority.
  
  # Sample of regular route:
  # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # You can have the root of your site routed by hooking up '' 
  # -- just remember to delete public/index.html.
  # map.connect '', :controller => "welcome"

  # Allow downloading Web Service WSDL as a file with an extension
  # instead of a file named 'wsdl'
  map.connect ':controller/service.wsdl', :action => 'wsdl'

  # Install the default route as the lowest priority.
  map.connect ':controller/:action/:id.:format'
  map.connect ':controller/:action/:id'
  
  #관리자화면팅 라우팅 설정 
  map.connect 'admin', :controller => "articles", :action => "index"
  map.connect 'admin/articles/:action/:id', :controller => "articles"
  map.connect 'admin/categories/:action/:id', :controller => "categories"
  map.connect 'admin/users/:action/:id', :controller => "users"
  map.connect 'admin/login/:action', :controller => "login"
  
  #메인화면 
  map.connect '', :controller => "blog", :action => "index"
  map.connect 'category/:id', :controller => "blog", :action => "category"
  map.connect 'tag/:id', :controller => "blog", :action => "tag"
  map.connect 'comment/:id', :controller => "blog", :action => "comment"
  map.connect ':id', :controller => "blog", :action => "article"
  
  # RSS
  map.connect 'rss.xml', :controller => "feed", :action => "rss"
end
